package com.lxq.market.servlet;

import com.lxq.market.service.CategoryService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/get_category")
public class GetCategoryServlet extends HttpServlet {

    private CategoryService categoryServer=CategoryService.getInstance();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<String> category = categoryServer.getCategoryName();
        resp.setContentType("text/plain;utf-8");
        resp.getWriter().println(category);
    }
}
